<template>
  <div class="Header">
    <h1>Header</h1>
    <p>count的值:{{ count }}</p>
    <p>price的值:{{ price }}</p>
    <button @click="increament">点我+1</button>

    <button @click="increamentN({ n: 5 })">点我+N</button>
    <button @click="incrementWait">等一等再加</button>
    <button @click="incrementNWait({ n: 3 })">等一等+N</button>
  </div>
</template>

<script>
import { mapMutations, mapState, mapActions } from "vuex";
export default {
  name: "Header",
  methods: {
    ...mapMutations("count", ["increament", "increamentN"]),
    ...mapActions("count", ["incrementWait", "incrementNWait"]),
  },
  computed: {
    ...mapState("count", ["count", "price"]),
  },
};
</script>

<style>
.Header {
  margin: 30px;
  background: green;
}
</style>